//package com.bicon.bdata_service_search.log;
//
//import java.util.logging.Filter;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.stereotype.Component;
//import org.springframework.util.StringUtils;
//
//import javax.servlet.*;
//import javax.servlet.annotation.WebFilter;
//import javax.servlet.http.HttpServletRequest;
//import java.io.IOException;
//import java.util.Enumeration;
///**
// * 描述:
// * log set
// *
// * @author zhaoyu
// * @email zhaoyu@vv.cc
// * @create 2018-08-22 14:49
// */
//@Component("requestLog")
//@WebFilter(filterName = "RequestLog", urlPatterns = "/*")
//@Slf4j
//public class RequestLog implements Filter {
//
//    @Override
//    public void init(FilterConfig filterConfig) throws ServletException {
//
//    }
//
//    @Override
//    public void doFilter(ServletRequest servletRequest, ServletResponse servletResponse,
//                         FilterChain filterChain)
//            throws IOException, ServletException {
//        HttpServletRequest request = (HttpServletRequest) servletRequest;
//
//        log.info("<=========================== Request Url ===========================>");
//
//        log.info(request.getRequestURL().toString());
//
//        log.info("<========================= Header Attribute ========================>");
//        Enumeration<?> e = request.getHeaderNames();
//        while (e.hasMoreElements()) {
//            String name = (String) e.nextElement();
//            String value = request.getHeader(name);
//            log.info(name + " = " + value);
//        }
//        log.info("<========================= Header Attribute ========================>");
//
//        String queryString = request.getQueryString();
//        if(!StringUtils.isEmpty(queryString)){
//            log.info("<========================= Get String ========================>");
//            log.info(queryString);
//        }
//
//        log.info("<========================= Request Param ===========================>");
//        Enumeration<?> eq = request.getParameterNames();
//        while (eq.hasMoreElements()) {
//            String name = (String) eq.nextElement();
//            String value = request.getParameter(name);
//            log.info(name + " = " + value);
//        }
//        log.info("<========================= Request Param ===========================>");
//
//        filterChain.doFilter(servletRequest, servletResponse);
//
//    }
//
//    @Override
//    public void destroy() {
//
//    }
//}